/*
 * @Author: sonss
 * @Date: 2024-08-19 17:00:16
 * @LastEditTime: 2024-08-22 12:12:33
 * @FilePath: /ss-file-antd/src/services/passport.ts
 * @Description:  账号
 */
import { request } from '@umijs/max';

// 生成验证码
export async function genCaptcha() {
  return request<API.Result<PASSPORT.GenCaptchaResponse>>('/captcha/generate', {
    method: 'GET',
  });
}

// 登录
export async function login(body: PASSPORT.LoginForm) {
  return request<API.Result<PASSPORT.LoginResponse>>('/passport/login', {
    method: 'POST',
    data: body,
  });
}

// 退出
export async function logout() {
  return request<API.Result<any>>('/passport/logout', {
    method: 'POST',
  });
}
